<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>create_column_config_file (column_transform.rb)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File column_transform.rb, line 51</span>
 <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create_column_config_file</span>(<span class="ruby-identifier">column_transform</span>)  
        <span class="ruby-keyword kw">if</span>  <span class="ruby-identifier">column_transform</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;split&quot;</span>
                <span class="ruby-identifier">config_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;column_split_config.csv&quot;</span>,<span class="ruby-value str">&quot;w&quot;</span>) 
        <span class="ruby-keyword kw">else</span>
                <span class="ruby-identifier">config_file</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;column_transform_config.csv&quot;</span>,<span class="ruby-value str">&quot;w&quot;</span>)     
        <span class="ruby-keyword kw">end</span>            
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;database_type,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;database,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;host,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;password,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;username,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;usage guidelines,&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;Please mention the transformation rules in this order:tablename &lt;comma&gt; original_column_name &lt;comma&gt; new_column_name1 &lt;comma&gt; new_column_name2&quot;</span>)
        <span class="ruby-identifier">config_file</span>.<span class="ruby-identifier">write</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
 <span class="ruby-keyword kw">end</span></pre>
</body>
</html>